home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #2 / Ham Radio 2000 - Volume 2.iso / HAMV2 / MISC / HCAL-27 / TINYCOIL.BAS (.txt) < prev    next >
Encoding:
GW-BASIC  |  1997-01-29  |  4.0 KB  |  156 lines

  1. 10  'TINYCOIL - Coils Wound on Nylon Screws - 07 JUN 96 rev. 28 SEP 96
  2. 20  IF EX$=""THEN EX$="EXIT"
  3. 30  CLS:KEY OFF
  4. 40  COLOR 7,0,1
  5. 50  U$="#####.###"
  6. 60  UL$=STRING$(80,205)
  7. 70  DIM GA(40)
  8. 80  DIM T$(9,3)
  9. 90  '
  10. 100  DATA 8,32,.164,      10,24,.19,    1/4,20,.25
  11. 110  DATA 5/16,18,.3125,  3/8,16,.375,  1/2,13,.5
  12. 120  DATA 5/8,11,.625,    3/4,10,.75,   1,8,1
  13. 130  FOR Z=1 TO 9:FOR Y=1 TO 3:READ T$(Z,Y):NEXT Y:NEXT Z
  14. 140  '
  15. 150  '.....AWG calculator
  16. 160  K=(0.46/0.005)^(1/39)    'increment multiplier
  17. 170  FOR Z=1 TO 40
  18. 180  N=Z+3
  19. 190  GA(Z)=0.46/K^N
  20. 200  NEXT Z
  21. 210  '
  22. 220  '.....start
  23. 230  CLS
  24. 240  COLOR 15,2
  25. 250  PRINT " TINY COILS - wound on Nylon screws";
  26. 260  PRINT TAB(57)"by George Murphy VE3ERP ";
  27. 270  COLOR 1,0:PRINT STRING$(80,223);
  28. 280  COLOR 7,0
  29. 290  GOSUB 1190   'preface
  30. 300  COLOR 0,7:LOCATE ,22
  31. 310  PRINT " Press 1 to continue or 0 to EXIT....."
  32. 320  COLOR 7,0
  33. 330  Z$=INKEY$:IF Z$=""THEN 330
  34. 340  IF Z$="0"THEN CLS:RUN EX$
  35. 350  IF Z$="1"THEN 450
  36. 360  GOTO 30
  37. 370  GOTO 450
  38. 380  '
  39. 390  '.....format input line
  40. 400  IF ZZ=AWG THEN X$="#####"ELSE X$=U$
  41. 410  LOCATE CSRLIN-1:PRINT SPC(7);
  42. 420  LOCATE CSRLIN,47:PRINT STRING$(7,".");USING X$;ZZ;
  43. 430  RETURN
  44. 440  '
  45. 450  '.....input data
  46. 460  VIEW PRINT 3 TO 24:CLS:VIEW PRINT:LOCATE 3
  47. 470  INPUT " ENTER: Inductance...............................(>H)";UH
  48. 480  ZZ=UH:GOSUB 390:PRINT " >H"
  49. 490  INPUT " ENTER: Wire gauge (range #10 to #28 AWG).......(AWG)";AWG
  50. 500  ZZ=AWG:GOSUB 390:PRINT " AWG bare wire"
  51. 510  WD=GA(AWG)
  52. 520  PRINT "        Wire diameter................................";USING U$;WD;
  53. 530  PRINT CHR$(34)
  54. 540  FOR Z=1 TO 9
  55. 550  T=VAL(T$(Z,2))     'threads per inch
  56. 560  P=1/T              'pitch
  57. 570  IF P>WD AND P-WD>=0.015 THEN 630
  58. 580  NEXT Z
  59. 590  BEEP:PRINT " WIRE TOO LARGE.....Press any key....."
  60. 600  IF INKEY$=""THEN 600
  61. 610  GOTO 450
  62. 620  '
  63. 630  OD=VAL(T$(Z,3))
  64. 640  IF P<=(2.5*WD)THEN 690
  65. 650  BEEP:PRINT " WIRE TOO SMALL.....Press any key....."
  66. 660  IF INKEY$=""THEN 660
  67. 670  GOTO 450
  68. 680  '
  69. 690  PRINT "        Coil form - use screw size...................";USING U$;OD;
  70. 700  PRINT CHR$(34);" ";T$(Z,1);"-";T$(Z,2);" thread"
  71. 710  PRINT "        Screw thread pitch = coil turn spacing =.....";USING U$;P;
  72. 720  PRINT CHR$(34)
  73. 730  V=P/2-0.0625*P
  74. 740  H=SQR(3)*V
  75. 750  D=2*(OD/2-H+WD)
  76. 760  PRINT "        Coil pitch diameter..........................";USING U$;D;
  77. 770  PRINT CHR$(34)
  78. 780  '
  79. 790  R=D/2
  80. 800  Q=R^2*T^2/UH
  81. 810  L=ABS(-10-SQR(100+36*R*Q))/2/Q
  82. 820  PRINT "        Coil length..................................";USING U$;L;
  83. 830  PRINT CHR$(34)
  84. 840  N=L*T
  85. 850  PRINT "        Number of turns..............................";USING U$;N;
  86. 860  GAP=P-WD
  87. 870  PRINT "        Gap between turns............................";USING U$;GAP;
  88. 880  PRINT CHR$(34)
  89. 890  X$="#####"
  90. 900  PRINT "        Turns per inch...............................";USING X$;T;
  91. 910  LD=L/D
  92. 920  PRINT "        Length-to-diameter ratio.....................";
  93. 930  IF LD>4 THEN COLOR 14,6
  94. 940  PRINT USING "#####.##:1 ";LD
  95. 950  COLOR 7,0
  96. 960  AMT=INT(3.14159*D*N+4)+1
  97. 970  PRINT "        Amount of wire required (including leads)....";USING X$;AMT;
  98. 980  PRINT CHR$(34)
  99. 990  PRINT
  100. 1000  IF LD>4 THEN BEEP:GOSUB 1040:GOTO 1390
  101. 1010  IF LD<0.4 THEN BEEP:GOSUB 1140:GOTO 1390
  102. 1020  GOTO 1390
  103. 1030  '
  104. 1040  PRINT TAB(M);
  105. 1050  COLOR 14,0
  106. 1060  PRINT "Most amateur radio applications require a length-to-diameter ratio"
  107. 1070  PRINT TAB(M);
  108. 1080  PRINT "of about 4:1 or less. If the ratio shown above is more than 4:1"
  109. 1090  PRINT TAB(M);
  110. 1100  PRINT "you might want to try again, selecting a larger wire size."
  111. 1110  COLOR 7,0
  112. 1120  RETURN
  113. 1130  '
  114. 1140  PRINT TAB(M);
  115. 1150  PRINT "Length-to-diameter ratio must be 0.4:1 or greater. Try again,"
  116. 1160  PRINT TAB(M);
  117. 1170  PRINT "using a smaller wire size."
  118. 1180  RETURN
  119. 1190  '.....preface
  120. 1200  M=7
  121. 1210  PRINT TAB(M);
  122. 1220  PRINT "Nylon screws make excellent small low-loss coil forms, providing"
  123. 1230  PRINT TAB(M);
  124. 1240  PRINT "automatic turn spacing for those of us who are all thumbs and fuzzy"
  125. 1250  PRINT TAB(M);
  126. 1260  PRINT "vision when it comes to winding tiny coils."
  127. 1270  PRINT
  128. 1280  PRINT TAB(M);
  129. 1290  PRINT "You can also make air-core coils by winding bare wire on a metal"
  130. 1300  PRINT TAB(M);
  131. 1310  PRINT "screw, then coat the entire coil with a liberal application of"
  132. 1320  PRINT TAB(M);
  133. 1330  PRINT "hot-melt glue. When the glue has cooled to a solid mass remove the"
  134. 1340  PRINT TAB(M);
  135. 1350  PRINT "screw by unscrewing it from the coil."
  136. 1360  PRINT
  137. 1370  RETURN
  138. 1380  '
  139. 1390  '.....end
  140. 1400  GOSUB 1430
  141. 1410  GOTO 220
  142. 1420  '
  143. 1430  'HARDCOPY
  144. 1440  GOSUB 1550:LOCATE 25,2:COLOR 14,6
  145. 1450  PRINT " Press 1 to print screen, 2 to print screen & ";
  146. 1460  PRINT "advance paper, or 3 to continue.";:COLOR 7,0
  147. 1470  Z$=INKEY$:IF Z$="3"THEN GOSUB 1550:RETURN
  148. 1480  IF Z$="1"OR Z$="2"THEN GOSUB 1550:GOTO 1500
  149. 1490  GOTO 1470
  150. 1500  FOR QX=1 TO 24:FOR QY=1 TO 80
  151. 1510  LPRINT CHR$(SCREEN(QX,QY));
  152. 1520  NEXT QY:NEXT QX
  153. 1530  IF Z$="2"THEN LPRINT CHR$(12)
  154. 1540  GOTO 1440
  155. 1550  LOCATE 25,1:PRINT STRING$(80,32);:RETURN
  156.